<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" />
</head>
<c:if test="${empty user}">
  <script type="text/javascript">
     var falg = confirm("您还没有登录,请先登录！");
	 //if(falg){
		 location.href='login.jsp';
	 //}
  </script>
  <!-- c:redirect url="login.jsp"/> -->
</c:if>
<body>
<div id="header" class="wrap">
	<div id="logo"> 
	   传习教育网上书城
	</div>
    <<div style="width:380px; height:50px; float:right; position:absolute; left:60%; top:2px; line-height:50px">
	    <img src="${pageContext.request.contextPath}/images/cart.gif" style="margin-bottom:-4px" width="26" height="23">
		         <c:if test="${!empty user}">
                                                      欢迎您： ${user.username} &nbsp;
                 </c:if> 
                 <c:if test="${empty user}">
                  <a href="${pageContext.request.contextPath}/login.jsp">登录</a>
				  <a href="${pageContext.request.contextPath}/register.jsp">注册</a> 
                 </c:if>
		</div>
	<div id="navbar">
		<div class="userMenu">
			<ul>
				<li class="current"><a href="${pageContext.request.contextPath}/book/user?method=logout">User首页</a></li>
				<li><a href="${pageContext.request.contextPath}/orderlist.jsp">我的订单</a></li>
				<li><a href="${pageContext.request.contextPath}/shopping.jsp">购物车</a></li>
				<li><a href="${pageContext.request.contextPath}/book/user?method=logout">注销</a></li>
			</ul>
		</div>
		<form method="post" name="search" action="${pageContext.request.contextPath}/book/product?method=search">
			搜索：<input class="input-text" type="text" name="keywords" />
			<input class="input-btn" type="submit" name="submit" value=""/>
		</form>
	</div>
</div>
<div id="content" class="wrap">
	<div class="list orderList">
			<table>
				<tr class="title">
					<th class="orderId">订单编号</th>
					<th>订单商品</th>
					<th class="userName">收货人</th>
					<th class="price">订单金额</th>
					<th class="createTime">下单时间</th>
					<th class="status">订单状态</th>
				</tr>
				<c:if test="${empty orderList}">
				   <c:redirect url="/book/order?method=show"/>
				</c:if>
				<c:if test="${empty orderList.shows}">
				<tr>
				  <td colspan="5"> 
				    <h3>您的订单空空ruye...</h3>
				    <h4>您可以先去 <a href="${pageContext.request.contextPath}/index.jsp">购物</a></h4>
				  </td>
				</tr>
				</c:if>
				<c:forEach items="${orderList.shows}" var="show">
				<c:forEach items="${show.products}" var="product"><!--  -->
				<tr>
					<td>${show.order.id}</td>
					<td class="thumb"><img src="${pageContext.request.contextPath}/${product.imgurl}" width="90" height="90"  /></td>
					<td>${show.order.receiverName}</td>
					<td>${show.order.money}</td>
					<td>${show.order.ordertime}</td>
					<td>
					   <c:if test="${show.order.paystate==0}">
				                            已完成
				      </c:if>
				       <c:if test="${show.order.paystate==1}">
				                 未完成           
				      </c:if>
					</td>
				</tr>
				</c:forEach>
				</c:forEach>
				
			</table>
			<div class="page-spliter">
				 <a href="${pageContext.request.contextPath}/book/order?method=show&pageIndex=1">首页</a>&nbsp;
 				<a href="${pageContext.request.contextPath}/book/order?method=show&pageIndex=${orderList.currentIndex-1}">上一页</a>
 				<a href="${pageContext.request.contextPath}/book/order?method=show&pageIndex=${orderList.currentIndex+1}">下一页</a>
 				<a href="${pageContext.request.contextPath}/book/order?method=show&pageIndex=${orderList.totalpages}">末页</a>
			</div>
	</div>
</div>
<div id="footer" class="wrap">
	传习教育网上书城 &copy; 版权所有

</div>
</body>
</html>
